<?php
namespace Admin\Controller;

class LoginLogController extends Controller {

    public function index() {
        $m    = D2();
        $page = $m->where($this->indexExpr)->order($this->sortExpr)->page2();

        $this->assign('page', $page)->display();
    }

    /**
     * doCleanLoginLog
     * 清理本月之前所有登陆日志
     *
     * @return void
     */
    public function doCleanLoginLog() {
        $day  = date('Y-m-01');
        $m    = D2();
        $expr = "l_l_create_time<'{$day}'";

        $m->where($expr)->delete();
        $msg = array('s' => true, 'm' => '清理成功');

        showJson($msg);
    }

}
